<?php
class Project_Role_Table extends CF_DbTable_Table{
	protected $_name = 'roles';

	public function getRoles($roleId = null){
		$query = $this->getAdapter()->select()
			->from('roles');
		if(!is_null($roleId)){
			$query->where('id=?',$roleId)
				->limit(1);
			$resource = $this->getAdapter()->query($query);
			$result = $resource->fetchAll();
			return $result[0];	
		}	
		$resource = $this->getAdapter()->query($query);
		$result = $resource->fetchAll();
		
		return $result;
	}
}
